package main

import "fmt"

//测试区块链
func main() {
	//1.创建区块链
	bc:=NewBlockChain()
	//2.添加交易
	bc.AddBlock("sent 1 btc to guoCong")
	bc.AddBlock("sent 2 bto to f")
	//3.区块链浏览器 range
	for _,v :=range bc.blocks{
		fmt.Printf("Data:%s\n",v.Data)
		fmt.Printf("Timestamp:%d\n",v.Timestamp)
		fmt.Printf("PrevHash:%d\n",v.PrevHash)
		fmt.Printf("Has:%x\n",v.Hash)
		fmt.Println()
	}

}